how to convert string array to number in javascript